﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package net.wooga.pets.controllers {
    import net.wooga.pets.events.*;
    import net.wooga.pets.models.*;
    import net.wooga.pets.constants.*;
    import org.robotlegs.mvcs.*;

    public class ShowExtraEnergyPopupCommand extends Command {

        public var tutorial:TutorialModel;
        public var user:UserModel;
        public var energy:EnergyModel;

        private static const MIN_LEVEL:int = 7;

        override public function execute():void{
            var _local1:int;
            var _local2:Object;
            var _local3:InfoEvent;
            if (((!(this.tutorial.isInTutorialMode)) && ((this.user.level >= MIN_LEVEL)))){
                _local1 = (this.energy.energy + this.energy.energyExtra);
                _local2 = {current_energy:_local1, max_energy:this.energy.energyMax};
                _local3 = new InfoEvent(EventConstants.CREATE_POPUP, GameConstants.EXTRA_BOOST_POPUP, _local2);
                dispatch(_local3);
            };
        }

    }
}//package net.wooga.pets.controllers 
